package com.job.Gai_Yian.Homework0715;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * @author Gai_Yian
 * @version 1.0
 * @since 2022-07-15 14:45:17
 */
public class StringConstructor {
    public static void main(String[] args) {
        byte[] bytes={97,98,99,100,101,102};
        String s1=new String(bytes);
        System.out.println(s1);

        String s2=new String(bytes,1,3);
        System.out.println(s2);

        char[] chars={'A','我',66,'!','=','他'};
        System.out.println(new String(chars));
        String s3=new String(chars,3,3);
        System.out.println(s3);

        String name="夏日一个雪糕";
        byte[] nameBytes=name.getBytes();
        System.out.println(Arrays.toString(nameBytes));

        char[] chars1=name.toCharArray();
        System.out.println(Arrays.toString(chars1));

        char c=name.charAt(3);
        System.out.println(c);
        System.out.println(name.length());
        for (int i = 0; i <name.length() ; i++) {
            System.out.println(i+"="+name.charAt(i));
        }

        String str="public class STringConstructor{";
        int count=0;
        for (int i = 0; i <str.length() ; i++) {
            if (Character.isUpperCase(str.charAt(i))){

            }
        }
    }
}
